package com.oyb.servlet;

import com.oyb.entity.Classes;
import com.oyb.entity.Student;
import com.oyb.service.ClassServies;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/StudentInsertQuery")
public class StudentInsertQueryServlet extends HttpServlet {
    private ClassServies classServies = new ClassServies();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Classes> classeslist = classServies.queryAllClasses();
        System.out.println(classeslist);
        req.setAttribute("classeslist",classeslist);
        req.getRequestDispatcher("addstudent.jsp").forward(req,resp);
    }
}
